﻿//using BomComparison.Algorithm.Comparers;
//using BomComparison.Core.Interface;
//using BomComparison.Core.Model;

//namespace BomComparison.Algorithm
//{

//    public class BomComparisonService : IBomComparisonService
//    {
//        // 添加 ComparisonType 属性，用于配置对比类型
//        public ComparisonType ComparisonType { get; set; } = ComparisonType.Both;

//        public ComparisonResult CompareBoms(List<BomItem> sourceBom, List<BomItem> targetBom)
//        {
//            if (sourceBom == null) throw new ArgumentNullException(nameof(sourceBom));
//            if (targetBom == null) throw new ArgumentNullException(nameof(targetBom));

//            var result = new ComparisonResult();
//            var result1 = new ComparisonResult();
//            // 根据 ComparisonType 执行不同的对比逻辑
//            if (ComparisonType == ComparisonType.PartNumber || ComparisonType == ComparisonType.Both)
//            {
//                // 按 PartNumber 对比
//                var partNumberComparer = new CompareByPartNumber();
//                partNumberComparer.CompareBoms(sourceBom, targetBom);
//                result = partNumberComparer.Result;
//            }

//            if (ComparisonType == ComparisonType.PartReference || ComparisonType == ComparisonType.Both)
//            {
//                // 按 PartReference 对比
//                var partReferenceComparer = new CompareByPartReference();
//                partReferenceComparer.CompareByReference(sourceBom, targetBom);
//                result1 = partReferenceComparer.Result;

//            }

//            return result;
//        }
//    }
//    public enum ComparisonType
//    {
//        PartNumber,      // 按 PartNumber 对比
//        PartReference,   // 按 PartReference 对比
//        Both             // 同时按 PartNumber 和 PartReference 对比
//    }

//}
